package com.cuanbo.dualscreenteachfu.receiver;

import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class MyReceiver extends android.content.BroadcastReceiver {
    private MyReceiverListener listener;

    public MyReceiver(MyReceiverListener listener){
        this.listener=listener;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        if(listener==null)return;
        if(intent.getAction().equals("com.cuanbo.dralscreenteachfu.action")){
            int type=intent.getIntExtra("type",0);
            if(type==1){
                listener.img1();
            }else if(type==2){
                listener.img2();
            }
            Log.i("luohao","type="+type);
        }
    }

    public interface MyReceiverListener{
        void img1();
        void img2();
    }
}
